#include<stdio.h>
int g(int n){
    int s=0;
    while(n>0)
        s+=n%10,n/=10;
    return s;
}
int f(int n){
    return n<10?n:(n%10)+f(n/10);
}

int main()
{
    printf("%d\n",0==f(0));
    printf("%d\n",1==f(1));
    printf("%d\n",15==f(12345));

    return 0;
}
